<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use Mail;
class EmailController extends Controller
{
    /**
     * 发封电子邮件提醒给用户。
     *
     * @param  string or array $email['user'] 收件人 
     * @param  string ['title'] 信件标题 
     * @param  array $user 传入邮件模板参数
     * @param  string $ModelPash 传入邮件模板参数
     * @return Response
     */
    static function sendEmailReminder($email,$user,$ModelPash='admin.EmailModel.index')
    {
        $bool = Mail::send($ModelPash, ['user' => $user], function ($m) use ($email) {
            $m->to($email['user'])->subject($email['title']);
        });
        return $bool;
    }    
}
